﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Adalbertus.BudgetPlanner.Domain;
using Adalbertus.BudgetPlanner.Domain.Repositories;
using NHibernate.Linq;

namespace Adalbertus.BudgetPlanner.Infrastructure.Repositories
{
    public class CashFlowRepository : Repository<CashFlow>, ICashFlowRepository
    {
        public CashFlowRepository(IUnitOfWork unitOfWork)
            : base(unitOfWork)
        {
        }

        public CashFlow GetBySaving(Saving saving)
        {
            return UnitOfWork.Session.Query<CashFlow>().SingleOrDefault(x => x.Saving == saving);
        }
    }
}
